<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Fungsi extends Authenticated{
	
	function __construct() {
		parent::__construct();
		$this->load->model("fungsi_model");
	}
	
	function index(){
		$this->list_fungsi() ;
	}
	
        function list_fungsi()
        {
            $data['list_fungsi']=$this->fungsi_model->get_all_fungsi();
            $this->load->view('header');
            $this->load->view('fungsi/list_fungsi',$data);
            $this->load->view('footer');
        }
        
        function add_fungsi()
        {
            $this->load->view('header');
            $this->load->view('fungsi/add_fungsi');
            $this->load->view('footer');
        }
        
        function add_fungsi_process()
        {
            $data = $_GET;
            $this->fungsi_model->add_fungsi($data);
            redirect(FUNGSI);
        }
        
        function edit_fungsi($id)
        {
            $data = $this->fungsi_model->get_fungsi($id);
            $this->load->view('header');
            $this->load->view('fungsi/form_edit_fungsi',$data);
            $this->load->view('footer');
        }
        
        function edit_fungsi_process()
        {
            $data = $_GET;
            $this->fungsi_model->update_fungsi($data);
            redirect(FUNGSI);
        }
        
        function delete_fungsi($id)
        {
            $this->fungsi_model->delete_fungsi($id);
            redirect(FUNGSI);
        }
	
}
/** End of file */
